package com.bmft.service;


import com.bmft.mapper.DiyCarPlateMapper;
import com.bmft.pojo.DiyCarPlate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author Jarvan
 * @create 2020/8/31 19:49
 */
@Component
public class InsertService {
    @Autowired
    DiyCarPlateMapper diyCarPlateMapper;

    @Async
    public void insert( String[] msgs) {
        DiyCarPlate diyCarPlate = new DiyCarPlate();
        //车牌号
        diyCarPlate.setLicensePlateNumber(msgs[0]);
        //驾照号
        diyCarPlate.setDrivenLicence(msgs[1]);
        //基站编号
        diyCarPlate.setBaseStation(msgs[2]);
        //基站坐标
        diyCarPlate.setCoord(msgs[3]);
        //创建时间,修改时间
        diyCarPlate.setCreateTime(new Date(System.currentTimeMillis()));
        diyCarPlate.setModifyTime(new Date(System.currentTimeMillis()));
        System.out.println("entity:  " + diyCarPlate);
//        diyCarPlateServicel.insertDiyCarPlate(diyCarPlate);
        diyCarPlateMapper.insert(diyCarPlate);
    }
}
